package com.swt.service.impl.S_impl;

import com.swt.dao.S_dao.GetCourseDao;
import com.swt.domain.Course;
import com.swt.service.S_service.GetCourseService;
import org.hibernate.criterion.DetachedCriteria;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

@Service(value = "S_getCourseService")
public class GetCourseServiceImpl implements GetCourseService {
    /*注入dao*/
    @Resource(name = "S_getCourseDao")
    private GetCourseDao getCourseDao;

    @Override
    public List<Course> getCourse(int id) {
        /*调用dao层*/
        List<Course> list = getCourseDao.getCourse(id);
        return list;
    }

    @Override
    public Course getCourseById(int id) {
        /*调用dao*/
        Course course = getCourseDao.getCourseById(id);
        return course;
    }

    @Override
    public List<Course> getCoursePersonal(int clubid) {
        List<Course> list = getCourseDao.getCoursePersonal(clubid);
        return list;
    }

    @Override
    public List<Course> getCourseBySelect(DetachedCriteria detachedCriteria) {

        /*调用dao*/
        List<Course> list = getCourseDao.getcourseBySelect(detachedCriteria);
        return list;
    }
}
